package my.practice.designpattern.factory;

/**
 * Created by 丁旭 on 2017/12/14.
 */
public class BeijingPizzaStore extends PizzaStore {
    IngredientFactory ingredientFactory;

    public BeijingPizzaStore() {
        ingredientFactory = new BeijingPizzaIngredientFactory();
    }

    @Override
    protected Pizza createPizza(PizzaType type) {
        if (type == PizzaType.Cheese) {
            return new ChessePizza(ingredientFactory);
        } else {
            return new ClamsPizza(ingredientFactory);
        }
    }
}
